#ifndef PROCESS_H_
#define PROCESS_H_

#define WORK_UNIT 1000

enum PCBState {
    	RUNNING,
        READY,
        INTERRUPTED,
        BLOCKED
} PCBState;

typedef struct {
	int	process_id;
	int next_step;
	enum PCBState state;
	int waiting_on;
	int owns;
} PCBStr;

typedef PCBStr* PCB;

PCB newPCB(const int process_id);
void setPcbBlocked(PCB pcb, const int waiting_on);
void setPcbReady(PCB pcb);



enum ProcessType {
	UI,
	CALCULATOR,
	PRODUCER,
	CONSUMER
} ProcessType;

typedef struct {
	int	num_instructions;
	int num_requests;
	int * requests;
	enum ProcessType process_type;
	PCB pcb;
} ProcessStr;

typedef ProcessStr* Process;

Process newProcess(const int id,
		           const int num_instructions,
                   const int num_requests,
                   enum ProcessType process_type);
int processInstruction(const Process process,
        		int starting_instruction);


#endif /* PROCESS_H_ */
